package com.dzsw.item;

import com.dzsw.item.config.AppConfig;
import org.apache.logging.log4j.util.Strings;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableEurekaClient
@EnableHystrix
@ComponentScan(basePackages = {
        "com.dzsw.item.controller",
        "com.dzsw.item.service",
        "com.dzsw.item.config"
})
public class App {

    public static void main(String[] args) {
        for (String arg : args) {
            if (Strings.isNotEmpty(arg) && arg.startsWith("--appconfig.name=")) {
                AppConfig.appName = arg.replace("--appconfig.name=", "");
            }
        }
        SpringApplication.run(App.class, args);
    }

}
